#ifndef __HELICOPTER_H__
#define __HELICOPTER_H__

#include "sceneObject.h"
#include "clamp.h"
#include <utility>

class Helicopter : public SceneObject{
	public:
		static const float zRotationAmount;
		static const float threadExtensionAmount;
		static const Point accelerateUpAmount;
		static const Point accelerateDownAmount;
		static const Point accelerateLeftAmount;
		static const Point accelerateRightAmount;
		static const Point ascendAmount;
		static const Point descendAmount;
	private:
        float zrotatedAngle;
        Point inclinationAngle;
        Point inclinationDiff;

        static const Point caccel;
        static const float maxSpeed;
        static const float airDrag;
        static const float inclinationFactor;

        void calculate();
	public:
        Helicopter(const Cube& cube, const Point& direction,const std::map<std::string,ObjectModelPtr>& models);
		~Helicopter();

		virtual void setModelMatrix();
		virtual void setSubModelMatrix(const std::string& name="");

		void move(float dx,float dy,float dz);

		virtual void timeStep();

		void rotate(float angle);
		void accelerate(const Point& dir);

		void extendThread(float offset);
		void shrinkThread(float offset);

		float getZRotatedAngle(){
			return this->zrotatedAngle;
		}

		Clamp* getClamp();

		Point getInclinationAngle(){
			return inclinationAngle;
		}

		Point getDiffInclinationAngle(){
			return inclinationDiff;
		}

		static std::string name(){
			return "helicopter";
		}
};

#endif /* __HELICOPTER_H__ */



